local HOME = os.getenv("HOME")
local lfs = pcall(require, "lfs")
module("config")

REALM = "Dalaran"
ACCOUNT = "Jerry"

-- DEBUG = true -- debugging, will start lua debugger on error
XML_DUMP_CONVERSION = true -- dump the lua source generated from the xml files
-- NO_CACHE = true -- do not use the cache of compiled lua files
-- NO_RUN = true -- do not run the simulator only start it (useful when doing an interactive session
DUMP = true -- dump a few things (events, Frame hierarchy, ...)
-- PROFILE_GLOBAL = true -- profile global functions
-- DEBUG_PROFILE = true -- profile everything using the debug hook
-- DELAY_ONLOAD = true
-- DEV_GRID = true
LUALINT = true -- perform lualint checking for lua source
XMLVALID = true -- perform XML Schema checking for XML files (except Bindings.xml) using xjparse

--[[
BASE_PATH is the relative path to FrameXML
i.e <BASE_PATH>/FrameXML and <BASE_PATH>/AddOns both exists and contains the
base FrameXML files and the Blizzard Addons.

This is exactly what the Blizzard extractor creates.
]]
VERSION = "3.2.0"
BUILD = "10116"
RELEASE = "Jul 15 2009"
TOC = 30200

if HOME then
	BASE_PATH = HOME.."/dev/temp/base-wow/wow-ui-source"
	ADDON_PATH = HOME.."/dev/temp"
else
	if not lfs then
		NO_CACHE = true
	end
	BASE_PATH = "e:\\Jeux (x86)\\World of Warcraft\\Blizzard Interface Data (enGB)"
	ADDON_PATH = ""
end

--[[
List of Blizzard's default addons, loaded from <BASE_PATH>/AddOns/Blizzard_<addonName>
]]
BLIZZARD_ADDONS = {
	"AchievementUI", "AuctionUI", "BarberShopUI", "BattlefieldMinimap",
	"BindingUI", "Calendar", "CombatLog", "CombatText", "GlyphUI",
	"GMSurveyUI", "GuildBankUI", "InspectUI", "ItemSocketingUI",
	"MacroUI", "RaidUI", "TalentUI", "TimeManager", "TokenUI",
	"TradeSkillUI", "TrainerUI", "GMChatUI", "ArenaUI", "DebugTools",
}
--~ LOAD_ALL_BLIZZARD_ADDONS = true

--[[
Other addons, the key is the addon "name", the value is the relative path to it.
i.e. <path>/<name>/<name>.toc must exist.
]]
ADDONS = {
--	["Talented"] = "Interface/AddOns",
--	["Talented_Data"] = "Interface/AddOns",
--	["Talented_Loader"] = "Interface/AddOns",
}

--[[
This is the login sequence, i.e. the sequence of events that is played out
by the simulator at login.
]]

LOGIN_SEQUENCE = {
	{ type="event", event="SPELLS_CHANGED" },
	{ type="update", },
	{ type="event", event="KNOWN_CURRENCY_TYPES_UPDATE" },
	{ type="update", },
	{ type="event", event="PLAYER_LOGIN" },
	{ type="update", },
	{ type="event", event="PLAYER_ENTERING_WORLD" },
	{ type="update", },
	{ type="event", event="PLAYER_ALIVE" },
	{ type="update", },
	{ type="update", elapsed = 5 },
}

ENTERCOMBAT_SEQUENCE = { -- units.lua
	{ type="event", event="PLAYER_REGEN_DISABLED" },
	{ type="func", func=function () Security:CombatLockdown(true) end },
}

LEAVECOMBAT_SEQUENCE = {
	{ type="func", func=function () Security:CombatLockdown(false) end },
	{ type="event", event="PLAYER_REGEN_ENABLED" },
}

PLAY_SEQUENCE = {
	{ type="update_unit", unit="all"},
	{ type="html_canvas", file="base.html" },
	{ type="script", content="InterfaceOptionsFrame:Show()", },
	{ type="html_canvas", file="options.html" },
	{ type="event", event="ACHIEVEMENT_EARNED", params = {1}, },
	{ type="update", elapsed = .15 },
	{ type="html_canvas", file="achievement.html" },
}

--[[
This is the logout sequence, i.e. the sequence of events that is played out
by the simulator at logout.
]]
LOGOUT_SEQUENCE = {
	{ type="update", },
	{ type="event", event="PLAYER_LEAVING_WORLD" },
	{ type="update", },
	{ type="event", event="PLAYER_LOGOUT" },
}
